﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="Customerselecter.aspx.cs"
    Inherits="Customerselecter" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>酒店好帮手-客 户 信 息 管 理</title>
    <base target="_self" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="/images/style.css" rel="Stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="/js/pagefunction.js"></script>
    <script language="javascript" type="text/javascript" src="/js/jiazai.js"></script>
    <script language="javascript" type="text/javascript" src="/js/jquery.tablesorter.js"></script>
    <script type="text/javascript" type="text/javascript">

        $(function () {
            $("#gvList").tablesorter();
        });

        $(function () {
            $("#checkall").click(

        function () {

            if (this.checked) {
                $("input[name='ids']").each(function () { this.checked = true; });
            } else {
                $("input[name='ids']").each(function () { this.checked = false; });
            }
            if (this.checked) {
                $("input[name='customerName']").each(function () { this.checked = true; });
            } else {
                $("input[name='customerName']").each(function () { this.checked = false; });
            }
        });
        });



        function jqchk(op) {  //jquery获取复选框值

            var tmp = "";
            var tmp1 = "";
            var chk_value = [];
            $('input[name="ids"]:checked').each(function () {
                chk_value.push($(this).val());
                var names = StringToArray($(this).val(), "元")[0];
                var ids = StringToArray($(this).val(), "元")[1];
                tmp = tmp + names + ",";
                tmp1 = tmp1 + ids + ",";

            });

            if (chk_value.length > 0) {
                window.returnValue = tmp + "元" + tmp1;  //返回值
                window.close();
            }
            else {
                alert("请至少选择一项");
            }
        }   

    </script>
</head>
<body style="overflow-x: hidden">
    <form id="form1" runat="server">
    <div>
        <table width="100%" class="tableBorder" border='1' cellspacing="0" style="border-collapse: collapse;"
            bgcolor="#ffffff" bordercolor="#cccccc">
            <tr align="center" valign="middle">
                <th height="22" colspan="88">
                    客 户 信 息 管 理
                </th>
            </tr>
            <tr>
                <td>
                    操作
                </td>
                <td>
                    <input type='checkbox' id='checkall' name='checkall' />全选/取消 &nbsp;&nbsp|&nbsp;&nbsp;
                    <asp:TextBox runat="server" ID="txbsearch" Width="80px"></asp:TextBox>
                    <asp:Button runat="server" ID="btnsearch" Text="查询" CssClass="btn" OnClick="btnsearch_Click" />
                    <input class="btn" type="button" onclick="jqchk('group')" value="选完了" />
                </td>
            </tr>
        </table>
        <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:GridView ID="gvList" runat="server" AllowPaging="false" CellPadding="2" AutoGenerateColumns="False"
                        GridLines="Both" EmptyDataText="当前页无数据" CssClass="tableBorder" Width="100%" OnPreRender="gvList_PreRender">
                        <Columns>
                            <asp:TemplateField HeaderText="序号">
                                <ItemTemplate>
                                    <input type='checkbox' id='ids' name='ids' value='<%# Eval("Id") %>元<%# Eval("customerName") %>' /><%# Eval("Id") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="客户名称">
                                <ItemTemplate>
                                    <%# Eval("customerName")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="custormeSex" HeaderText="性别" />
                            <asp:BoundField DataField="customerTel0" HeaderText="手机" />
                            <asp:BoundField DataField="customerTel1" HeaderText="customerTel1" Visible="false" />
                            <asp:BoundField DataField="customerTel2" HeaderText="customerTel2" Visible="false" />
                            <asp:BoundField DataField="customerlandline0" HeaderText="固定电话" />
                            <asp:BoundField DataField="customerlandline1" HeaderText="customerlandline1" Visible="false" />
                            <asp:BoundField DataField="customerlandline2" HeaderText="customerlandline2" Visible="false" />
                            <asp:BoundField DataField="customerAddress0" HeaderText="客户住址" />
                            <asp:BoundField DataField="customerMeetAddress" HeaderText="客户订餐地址" />
                            <asp:BoundField DataField="memo" HeaderText="说明" />
                            <asp:TemplateField HeaderText="客户级别">
                                <ItemTemplate>
                                    <%#FTchina.SMS.CustomerInfo.GetCustomGroupByGroupID(Eval("customerGroupID").ToString())%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="callcount" HeaderText="callcount" Visible="false" />
                            <asp:BoundField DataField="meetCount" HeaderText="meetCount" Visible="false" />
                            <asp:TemplateField HeaderText="最后来电">
                                <ItemTemplate>
                                    <%#Eval("lastCallDate").ToString().Replace("1910-1-1 0:00:00", "")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="最后订餐">
                                <ItemTemplate>
                                    <%#Eval("lastMeetDate").ToString().Replace("1910-1-1 0:00:00", "")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Visible="False" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <asp:Literal runat="server" ID="litpager"> </asp:Literal>
        <div style="color: Gray">
            提示：点击表头可以排序</div>
    </div>
    </form>
    <script language='javascript' type='text/javascript' src='/JS/tablecolor.js'></script>
    <script type='text/javascript' language='javascript'><!--
        TableColor('gvList', '#F1F8FE', '#FFFFFF', '#F8DC87', '#BCE774');
    --></script>
</body>
</html>
